type RuleKey = "required" | "phone" | "idCard";
export default function getRuleByName(
    type: RuleKey,
    message = "",
    trigger = "change",
) {
    let obj: any = {
        required: {
            required: true,
            message,
            trigger,
        },
        phone: {
            pattern: /^\d{11}$/,
            message,
            trigger,
        },
        idCard: {
            pattern: /^[a-zA-Z0-9]{18}$/,
            message,
            trigger,
        },
    };
    return obj[type];
}
